﻿using Missbot.Core.Base;
using Dolany.UtilityTool;
using JetBrains.Annotations;
using Missbot.AIModule.OnlineStore;

namespace Missbot.AIModule.Vip.VipArmers
{
    [UsedImplicitly]
    public class 迷之匣 : IVipArmer
    {
        public string Name { get; set; } = "迷之匣";
        public string Description { get; set; } = "随机获得一个正在商店售卖的商品，每天最多购买2次";
        public int DiamondsNeed { get; set; } = 50;
        public VipArmerLimitInterval LimitInterval { get; set; } = VipArmerLimitInterval.Daily;
        public int LimitCount { get; set; } = 2;

        public bool Purchase(InboxSession session)
        {
            var shopItems = TransHelper.GetDailySellItems();
            var randItem = shopItems.RandElement();
            var itemColle = ItemCollectionDA.Get(session.User.ID);
            var msg = itemColle.ItemIncome(randItem.Name);
            msg = $"恭喜你获得了 {randItem.Name}\n{msg}";
            session.SendBack(msg);

            return true;
        }

        public int MaxContains { get; set; }
    }
}